package gcontent.entities.content.html;

import gcontent.entities.content.error.ContentEx;
import gcontent.entities.site.SiteURL;
import gcontent.record.error.RecordEx;
import gcontent.rsrc.ThreadResources;

import java.net.URL;

public class RefHTML extends SiteURL {
	
	private String type;
	private ContentHTML content_html;
	
	/* type tag */
	public String getType()
	{
		return this.type;
	}
	
	public void setType(String type)
	{
		this.type = type;
	}
	
	public RefHTML()
	{		
		super();
	}

	public RefHTML(ContentHTML content_html, String type, URL url_ref)
	{
		this();
		
		this.content_html = content_html;
		
		this.type = type;
		this.url = url_ref;
		this.protocol = url_ref.getProtocol();
	}	
	
	public void save() throws ContentEx, RecordEx
	{
		
		this.id = (Integer)this.record.execProc("PROC_CreateRefHTML", 
				  	this.content_html.getId(),
				  	this.type,
				  	this.url.toString(),
				  	this.protocol
				  );			
	}

}
